/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: jingziyou
 * Date: 2023-04-10
 * Time: 16:12
 */

import java.util.Scanner;

public class InDemo {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.print("输入姓名：");
        String name = input.nextLine();

        System.out.print("输入性别：");
        char sex = input.next().charAt(0);

        System.out.print("是否有津贴（true/false）：");
        boolean dressAllowance = input.nextBoolean();

        Worker worker = new Worker(name, sex, dressAllowance);

        System.out.println("姓名：" + worker.getName() + "，性别：" + worker.getSex() + "，是否提供津贴：" + worker.isDressAllowance());
    }
}

class Employee {
    private String name;
    private char sex;

    public Employee(String name, char sex) {
        this.name = name;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public char getSex() {
        return sex;
    }
}

class Worker extends Employee {
    private boolean dressAllowance;

    public Worker(String name, char sex, boolean dressAllowance) {
        super(name, sex);
        this.dressAllowance = dressAllowance;
    }

    public String isDressAllowance() {
        if (dressAllowance) {
            return "提供津贴";
        } else {
            return "不提供津贴";
        }
    }
}